<!doctype html>
<html>
<head>
	<meta charset="utf-8"><meta name="format-detection" content="telephone=no">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
	<title>我的</title>
	<link rel="stylesheet" type="text/css" href="../../lib/css/skin.css"/>
</head>
<body>
<div id="root">
	<div class="app_warp">

		<div class="app_head">
			<span class="left back"></span>
			<span class="name">学生</span>
			<span class="right" tapmode onclick="addXueSheng()">
				添加
			</span>
		</div>

		<div class="xuesheng_list_tit clearfix">
			<span class="xuesheng_name">学生姓名</span>
			<span class="xuesheng_tel">联系方式</span>
			<span class="xuesheng_intro">艺考方向</span>
		</div>

		<div id="students" class="app_main">
			<div class="nocontent animated fadeInUp">
				<img src="../../lib/img/loading.gif" class="minimize" alt="">
				<div class="text minimize">
					数据加载中
				</div>
			</div>
		</div>

	</div>
</div>
<script id="student_template" type="text/html">
	<ul class="xuesheng_list">
		<%for(var i in data){ var item=data[i];window['tempData'+i]=item %>
		<li class="clearfix" tapmode onclick="viewStudentIntro('tempData<%:=i%>')">
			<span class="xuesheng_name"><%:=item.name%></span>
			<span class="xuesheng_tel"><%:=item.phone%></span>
			<span class="xuesheng_intro">
				<%for(var j in item.curriculum){%>
					<%:getClassifyName=item.curriculum[j]%>
				<%}%>
			</span>
		</li>
		<%}%>
	</ul>
</script>
<script>
	var
		viewStudentIntro = function (data) {
			api.openWin({
				name: 'view_xuesheng',
				url: './view_xuesheng.html',
				pageParam: window[data]
			})
		},
		addXueSheng = function () {
			api.openWin({
				name: 'xuesheng_add',
				url: './xuesheng_add.html'
			})
		},
		loadData = function () {
			_$.ajax({
				interface: 'getMyStudent',
				call: function (data) {
					if (data.status == 200) {
						_$.template('student_template', data, function (html) {
							$('#students').html(html)
						})
					} else {
						$('#students').html('<div class="nocontent animated fadeInUp"><img src="../../lib/img/noproducts.png" alt=""><div class="text">您暂时还没有学生</div></div>');
						$('.xuesheng_list_tit').hide();
					}
				}
			})
		},
		appready = function () {
			loadData()
		};
</script>
<script src="../../lib/js/config.js"></script>
<script src="../../lib/js/jquery.js"></script>
<script src="../../lib/js/common.js"></script>
</body>
</html>